package com.example.demo.controller;



import com.example.demo.datasource.multi.entity.test2quary;
import com.example.demo.datasource.multi.entity.testquary;
import com.example.demo.datasource.multi.service.test2service;
import com.example.demo.datasource.multi.service.testservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * Created by w on 2018/8/30.
 */
@Controller
public class demo {

    @Autowired
    testservice testservice;

    @Autowired
    com.example.demo.datasource.multi.service.test2service test2service;

    @RequestMapping(value= "hello")
    @ResponseBody
    public String test(){
        return "hello ,spring boot!!";
    }

    @RequestMapping("/test")
    @ResponseBody
    public List<testquary> hello(){
        List<testquary> result;
        result= testservice.quarytest();
        return result;

    }

    @RequestMapping("/test2")
    @ResponseBody
    public List<test2quary> hello2(){
        List<test2quary> result;
        result= test2service.quarytest();
        return result;

    }

}
